import re 
uprss = 20000.0 #上拉电阻，单位为欧姆
voltage = 5.0 #上拉电源
voltage_reference = 4.5 #电压基准

file = open("输入.txt","r")
content = file.read()
file.close()
lines = content.splitlines()
ts = open("输出.txt","w+")
for line in lines:
	numbers = re.findall(r'\d+\.?\d*',line)
	num = float(numbers[2])
	number = int(num*1000/(num*1000+uprss)*voltage/voltage_reference*32767)
	ts.write(str(number))
	ts.write(",")	
ts.close()





